<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<style>
    .success {
        color: green;
    }

    .error {
        color: red;
    }
</style>
<body>
    <div id="app">
        <ul>
            <li v-for="(item, index) in 6" :key="index" :class="index%2==0?'success':'error'">{{item}}</li>
        </ul>
        <ul>
            <li v-for="(item, index) in 6" :key="index" :class="index | getClass">{{item}}</li>
        </ul>
        <hr>
        <p>{{"链式调用" | fun1 | fun2 | fun3}}</p>
    </div>

</body>
<script>
    new Vue({
        el:"#app",
        data:{
           
        },
        computed: {
            
        },
        filters:{
            getClass(target){
                return target%2==0?'success':'error';
            },
            fun1(target){
                return target+":fun1";
            },
            fun2(target){
                return target+":fun2";
            },
            fun3(target){
                return target+":fun3";
            }
        } 
    });
</script>
</html>